package org.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.pojo.Result;
import org.example.pojo.UserFollows;
import org.example.service.UserFollowsService;
import org.example.mapper.UserFollowsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

/**
* @author Xiri
* @description 针对表【user_follows】的数据库操作Service实现
* @createDate 2025-07-19 00:53:30
*/
@Service
public class UserFollowsServiceImpl extends ServiceImpl<UserFollowsMapper, UserFollows>
    implements UserFollowsService{

	/**
	 *	是否关注判断
	 */
	@Override
	public Boolean whetherInterest(Integer uid,Integer followingId) {
		QueryWrapper qw = new QueryWrapper();
		qw.eq("user_id",uid);
		qw.eq("following_id",followingId);
		UserFollows one = getOne(qw);
		
		return one != null;
	}
}




